<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- Bootstrap core CSS -->
    <link href="../../static/css/bootstrap.min.css" rel="stylesheet" th:href="@{/static/css/bootstrap.min.css}">
    <!-- Custom styles for this template -->
    <link href="../../static/css/dashboard.css" rel="stylesheet" th:href="@{/static/css/dashboard.css}">
    <script src="../../static/js/jquery-3.6.0.js" th:src="@{/static/js/jquery-3.6.0.js}"
            type="text/javascript"></script>
</head>
<body>
<div th:insert="student/common::topbar"></div>
<div class="container-fluid">
    <div class="row">
        <!--侧边栏-->
        <div th:insert="~{student/common::sidebar(active='course.html')}"></div>
        <main class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4" role="main">
            <div class="table-responsive">
                <table class="table table-hover table-bordered table-striped table-sm">
                    <thead>
                    <tr>
                        <th>学号</th>
                        <th>课程编号</th>
                        <th>姓名</th>
                        <th>课程</th>
                        <th>班级</th>
                        <th>必修|选修</th>
                        <th>课程类型</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr th:each="course:${courseList}">
                        <td th:text="${course.getSno()}"></td>
                        <td th:text="${course.getCid()}"></td>
                        <td th:text="${course.getSname()}"></td>
                        <td th:text="${course.getCname()}"></td>
                        <td th:text="${course.getSclass()}"></td>
                        <td th:text="${course.getClasses()}"></td>
                        <td th:text="${course.getCourse_type()}"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <nav aria-label="Page navigation" class="page-header">
                <ul class="pagination">
                    <li>
                        <a aria-label="Previous" id="pagePrevious"
                           th:href="@{/student/getCourse/{sno}/{page}/{size}(sno=${session.student.getSno()},page=${page}-1,size=${size})}"
                           th:if="${lastPage}">
                            <span aria-hidden="true">&laquo;</span>
                        </a>
                    </li>
                    <li><a class="nav active" id="page1"
                           th:href="@{/student/getCourse/{sno}/{page}/{size}(sno=${session.student.getSno()},page=${page},size=${size})}"
                           th:if="courseList!=null" th:text="${page}"></a></li>
                    <li><a id="page2"
                           th:href="@{/student/getCourse/{sno}/{page}/{size}(sno=${session.student.getSno()},page=${page+1},size=${size})}"
                           th:if="${number} gt ${page*10}" th:text="${page}+1"></a></li>
                    <li><a id="page3"
                           th:href="@{/student/getCourse/{sno}/{page}/{size}(sno=${session.student.getSno()},page=${page+2},size=${size})}"
                           th:if="${number} gt ${(page+1)*10}" th:text="${page}+2"></a></li>
                    <li><a id="page4"
                           th:href="@{/student/getCourse/{sno}/{page}/{size}(sno=${session.student.getSno()},page=${page+3},size=${size})}"
                           th:if="${number} gt ${(page+2)*10}" th:text="${page}+3"></a></li>
                    <li><a id="page5"
                           th:href="@{/student/getCourse/{sno}/{page}/{size}(sno=${session.student.getSno()},page=${page+4},size=${size})}"
                           th:if="${number} gt ${(page+3)*10}" th:text="${page}+4"></a></li>
                    <li>
                        <a aria-label="Next" id="pageNext"
                           th:href="@{/student/getCourse/{sno}/{page}/{size}(sno=${session.student.getSno()},page=${page}+1,size=${size})}"
                           th:if="${nextPage}">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </ul>
            </nav>
        </main>
    </div>

</div>

<script src="../../static/js/jquery-3.2.1.slim.min.js" th:src="@{/static/js/jquery-3.2.1.slim.min.js}"
        type="text/javascript"></script>
<script src="../../static/js/popper.min.js" th:src="@{/static/js/popper.min.js}" type="text/javascript"></script>
<script src="../../static/js/bootstrap.min.js" th:src="@{/static/js/bootstrap.min.js}" type="text/javascript"></script>
<!-- Icons -->
<!--<script type="text/javascript" th:src="@{/static/js/feather.min.js}" src="../../static/js/feather.min.js"></script>-->
<!--<script>
    feather.replace()
</script>-->
<!-- Graphs -->
<!--<script type="text/javascript" th:src="@{/static/js/Chart.min.js}" src="../../static/js/Chart.min.js"></script>-->
</body>
</html>